<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>

<input id="button" type="button" value="test">

</body>
<script src="/jquery.min.js"></script>
<script type="text/javascript">

    $("#button").click(function () {

        $.ajax({
            url: '/test',
            type: 'get',
            success: function (response) {
                alert(response.data)
            },
            error: function (xhr, status) {
                alert(xhr.status + "  " + xhr.response.data)
            }
        });

    });

</script>

</html>